<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h1>函数剩余参数</h1>
    <script>
        // 获取最大值
        const getMax = (...args) => {
            // 假设数组的第一个元素的值最大
            var max = args[0]
            args.forEach(item => {
                if (item > max) {
                    max = item
                }
            })
            return max
        }
        console.log(getMax(1, 212, 23, 888, 194));

        console.log(getMax(100, 222, 823));

    </script>
</body>

</html>